<ui:composition template="/modulos/index/template/default.xhtml"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="body" oncontextmenu="return false">
    	<h:form id="frmList" ajaxSubmit="false">
        <p:growl id="msgSystem" showDetail="false" life="5000" escape="true"/>  
        <p:toolbar>
        	<p:toolbarGroup align="left">          
            <p:spacer height="6px"/>
            <p:outputLabel for="txtIns" value="Institución" style="position:relative;  top:-4px;"/>
            	<p:selectOneMenu id="txtIns" value="#{adminMetaCetpro.institucion}" style="position:relative;  top:3px; left:15px; width:300px">
                	<f:selectItems value="#{adminMetaCetpro.institucionList}" />
                  	<p:ajax event="change" update=":frmList" listener="#{adminMetaCetpro.defaultList}"/>
               	</p:selectOneMenu>
          	<p:spacer height="6px"/>
            <p:commandButton title="Nuevo" value="Nuevo" icon="icn_bar_new" actionListener="#{adminMetaCetpro.nativeNew}" ajax="false" rendered="#{adminMetaCetpro.institucion ne -1}" style="position:relative;  top:-4px; left:30px;"/>
      		</p:toolbarGroup>  
        </p:toolbar>
       	<p:spacer height="4px"/>

        <p:dataTable id="itemList" var="item" value="#{adminMetaCetpro.beanList}" filteredValue="#{adminMetaCetpro.beanFilterList}"
            emptyMessage="#{constante.LIST_EMPTY}" resizableColumns="true"  paginatorPosition="bottom" paginator="true" rows="7"  
           	paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} ">
         
        	<f:facet name="header">
            	<h:outputText value="Meta Ocupacional" />  
           	</f:facet>
                                                 
            <p:column headerText="Profesión" style="width:73%; align:center;" >  
            	<h:outputText value="#{item.nombreProfesion}"/>
           	</p:column>            
                 
            <p:column headerText="Mínimo" style="width:20%; align:center;" >  
              	<h:outputText value="#{item.minimo}"/>
			</p:column>    
                 
            <p:column headerText="Operaciones" style="width:7%">  
            	<p:commandButton icon="icn_item_update"         title="Actualizar"              action="#{adminMetaCetpro.nativeLoad}" ajax="false">
                	<f:setPropertyActionListener value="#{item}" target="#{adminMetaCetpro.beanSelected}" />
				</p:commandButton>
                <p:commandButton icon="icn_item_download"       title="Descargar Resolución"  ajax="false">
                	<f:setPropertyActionListener value="#{item}" target="#{adminMetaCetpro.beanSelected}" />
					<p:fileDownload value="#{adminMetaCetpro.file}"/>
                </p:commandButton>
          	</p:column>
      	</p:dataTable>
  		</h:form>
   </ui:define>
</ui:composition>

